package com.atmc.controller;

import com.atmc.bean.User;
import com.atmc.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class UserController {
    @Autowired
    UserMapper userMapper;
//
//    @RequestMapping("/user/member-list")
//    public String toMemberlist() {
//
//        return "user/member-list";
//    }
    @RequestMapping("/memberadd")
    public String tomemberadd(){

        return "user/memberAdd";
    }
    //查询详情
    @RequestMapping("/touserdetails/{user_name}")
    public String touserDetail(@PathVariable("user_name")String user_name, Model model){
        User user = userMapper.selectOne(user_name);
        model.addAttribute("user",user);
        return "user/userDetail";
    }

}
